/*
    Copyright (c) 2012 Denis Mingulov.

    This file is part of Drop Cache.

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef DROPCACHEWIDGET_H
#define DROPCACHEWIDGET_H

#include <QtCore/QScopedPointer>
#include <QtCore/QStringList>
#include <meegotouch/MStylableWidget>

#include "dropcachewidgetstyle.h"

class MLabel;
class MContainer;

class DropCacheWidget : public MStylableWidget
{
    Q_OBJECT
    M_STYLABLE_WIDGET(DropCacheWidgetStyle);

public:
    DropCacheWidget(QGraphicsItem *parent = 0);
    virtual ~DropCacheWidget();
    virtual void createContent();

protected:
    virtual QGraphicsLayoutItem *createHeader() const;
    virtual MContainer *createEmptyContainer(const QString &containerStyle = QString(), bool headerVisible = true) const;
    virtual QGraphicsLayoutItem *createSpacer(const QString &style = QString()) const;
    virtual MContainer *createInfoContainer();
    virtual MContainer *createSyncContainer();
    virtual MContainer *createCacheContainer();

protected slots:
    virtual void clickedInfo();
    virtual void doDrop1();
    virtual void doDrop2();
    virtual void doDrop3();
    virtual void doSync();
    virtual void doSyncAndDrop();
    virtual void doInfoRefresh();

    virtual void handleDisplayEvent();

protected:
    virtual void execApp(const QString &name, const QStringList &param);

private:
    //! Private data
    QScopedPointer<class DropCacheWidgetPrivate> d_ptr;
};

#endif // DROPCACHEWIDGET_H
